<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
    <title>青芸社区</title>
    <script src="/static/js/jquery-2.0.0.min.js" type="application/javascript"></script>
    <link href="/static/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="/static/css/bootstrap-theme.min.css" rel="stylesheet"/>
    <link href="/static/css/community.css" rel="stylesheet"/>
    <script src="/static/js/bootstrap.min.js" type="application/javascript"></script>

</head>

<body>
<!--导航栏-->
<nav th:insert="navigation :: nav"></nav>
<div class="container-fluid main">
    <div class="row">
        <div class="col-lg-9 col-md-12 col-sm-12 col-xs-12">
            <div class="row">
                <div class="col-lg-10 col-md-12 col-sm-12 col-xs-12">
                    <h2><span aria-hidden="true" class="glyphicon glyphicon-list"></span> 发现</h2>
                </div>
            </div>
            <hr>
            <div class="media" th:each="question : ${pagination.questions}">
                <div class="media-left">
                    <a href="#">
                        <img class="sm_img img-rounded" th:src="${question.user.avatarUrl}">
                    </a>
                </div>
                <div class="media-body">
                    <h4 class="media-heading">
                        <a th:href="@{'/question/'+${question.id}}" th:text="${question.title}"></a>
                    </h4>
                    <span th:text="${question.description}"></span><br>
                    <span class="text-desc">
                            <span th:text="${question.commentCount}"></span>个回复 ·  <span
                            th:text="${question.viewCount}"></span>浏览· <span
                            th:text="${#dates.format(question.gmtCreate,'yyyy-MM-dd HH:mm')}"></span>
                        </span>
                </div>
                <hr>
            </div>
            <nav aria-label="Page navigation" th:if="${pagination.questionCount >= pagination.pageSize}">
                <ul class="pagination">
                    <li th:if="${pagination.showFirstPage == true}">
                        <a href="/?page = 1" aria-label="Previous">
                            <span aria-hidden="true">&laquo;</span>
                        </a>
                    </li>
                    <li th:if="${pagination.showPrevious == true}">
                        <a th:href="@{/(page = ${pagination.page - 1})}" aria-label="Previous">
                            <span aria-hidden="true"><</span>
                        </a>
                    </li>
                    <li th:each="page:${pagination.pages}" th:class="${pagination.page == page}?'active':''">
                        <a th:text="${page}"
                           th:href="@{/(page = ${page})}">
                        </a>
                    </li>
                    <li th:if="${pagination.showNext == true}">
                        <a th:href="@{/(page = ${pagination.page + 1})}" aria-label="Next">
                            <span aria-hidden="true">></span>
                        </a>
                    </li>
                    <li th:if="${pagination.showEndPage == true}">
                        <a th:href="@{/(page = ${pagination.pageCount})}" aria-label="Next">
                            <span aria-hidden="true">&raquo;</span>
                        </a>
                    </li>
                </ul>
            </nav>
            <span th:if="${pagination.pageCount == 0}">还没有信息！</span>
        </div>
        <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12">
            <h3>热门话题</h3>
        </div>
    </div>
</div>
</body>
</html>